//
//  RBHomeSecKillItemView.m
//  zhongzhenglu
//
//  Created by XL on 2022/5/26.
//

#import "RBHomeSecKillItemView.h"
#import "RanTool.h"
#import <YYCategories.h>
#import "RBDefine.h"
#import "UIView+RBAdd.h"

@interface RBHomeSecKillItemView()

@property(nonatomic, strong)IBOutlet UIImageView *imgView;
@property(nonatomic, strong)IBOutlet UILabel *titleL;
@property(nonatomic, strong)IBOutlet UILabel *priceL;
@property(nonatomic, strong)IBOutlet UILabel *oriPriceL;

@end

@implementation RBHomeSecKillItemView

- (void)awakeFromNib
{
    [super awakeFromNib];
    [self zoomSubViewsWithSelf];
}

//赋值
- (void)setModel:(RBHomeSeckillModel *)model {
    _model = model;
    
    [self.imgView setImageWithUrl:model.picurl placeHolder:nil];
    
    self.titleL.text = model.good_name;
    
    UIColor *color = [UIColor colorWithHexString:@"#F04D27"];
    self.priceL.attributedText = [RanTool attributeStringMaker:^(NSMutableArray *maker) {
        [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(11)] color:color string:@"¥"];
        [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(15)] color:color string:model.current_price];
    }];
    self.oriPriceL.text = model.goods_price;
}

@end
